CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(prj-gtatxd CXX)

ADD_SUBDIRECTORY(src)

IF(prj-gtaformats_SOURCE_DIR)
    SET(GTAFORMATS_INCLUDE_PATH "${prj-gtaformats_SOURCE_DIR}" CACHE PATH "Path to the gtaformats include dir (EXCLUDING the 'gtaformats' part)")
ELSE(prj-gtaformats_SOURCE_DIR)
    SET(GTAFORMATS_INCLUDE_PATH "" CACHE PATH "Path to the gtaformats include dir (EXCLUDING the 'gtaformats' part)")
ENDIF(prj-gtaformats_SOURCE_DIR)

SET(GTAFORMATS_LIB_PATH "gtaformats" CACHE PATH "Path to (or name of) the libgtaformats library file")
SET(BOOST_INCLUDE_PATH "" CACHE PATH "Path to the Boost include dir")
SET(BOOST_REGEX_LIB_PATH "boost_regex" CACHE PATH "Path to (or name of) the Boost::RegEx library file")
SET(SQUISH_INCLUDE_PATH "" CACHE PATH "Directory containing libsquish header files.")
SET(SQUISH_LIB_PATH "squish" CACHE PATH "Path to (or name of) libsquish library file")
SET(PNG_INCLUDE_PATH "" CACHE PATH "Path to the libpng include dir")
SET(PNG_LIB_PATH "png" CACHE PATH "Path to (or name of) the libpng library file")
SET(Z_INCLUDE_PATH "" CACHE PATH "Path to the zlib include dir")
SET(Z_LIB_PATH "png" CACHE PATH "Path to (or name of) the zlib library file")

IF(NOT GTAFORMATS_LIB_PATH)
	SET(GTAFORMATS_LIB_PATH gtaformats)
ENDIF(NOT GTAFORMATS_LIB_PATH)
IF(NOT BOOST_REGEX_LIB_PATH)
	SET(BOOST_REGEX_LIB_PATH boost_regex)
ENDIF(NOT BOOST_REGEX_LIB_PATH)
IF(NOT SQUISH_LIB_PATH)
	SET(SQUISH_LIB_PATH squish)
ENDIF(NOT SQUISH_LIB_PATH)
IF(NOT PNG_LIB_PATH)
	SET(PNG_LIB_PATH png)
ENDIF(NOT PNG_LIB_PATH)
IF(NOT Z_LIB_PATH)
	SET(Z_LIB_PATH png)
ENDIF(NOT Z_LIB_PATH)

INCLUDE_DIRECTORIES(${GTAFORMATS_INCLUDE_PATH} ${BOOST_INCLUDE_PATH} ${SQUISH_INCLUDE_PATH} ${PNG_INCLUDE_PATH} ${Z_INCLUDE_PATH})

ADD_EXECUTABLE(gtatxd ${SRCS})
TARGET_LINK_LIBRARIES(gtatxd ${BOOST_REGEX_LIB_PATH} ${GTAFORMATS_LIB_PATH} ${SQUISH_LIB_PATH} ${PNG_LIB_PATH} ${Z_LIB_PATH})

INSTALL(TARGETS gtatxd DESTINATION bin)

